import React from "react";
import { Spin } from "antd";

import "./index.less";

const empty = require("../../assets/images/empty.png");

const App = (props) => {

  const isRequest = props.isRequest || true;
  const image = props.image || empty;
  const text = props.text || "暂无数据"
  const height = props.height || "220px"

  return (
    <div className="app-empty" style={{ height }}>
      {
        isRequest ? (
          <Spin size="large" tip="加载中..."></Spin>
        ): (
          <div className="empty-container">
            <img className="image" src={image} alt="empty"></img>
            <div className="text">{ text }</div>
          </div>
        )
      }
    </div>
  );
};

export default App;
